<template>
  <div class="flex">
    <div class="card mr-4">
      <img class="mr-4" :src="menu?.img" />
      <div class="flex flex-col">
        <span :class="['name', menu?.num_bg]">
          {{ menu?.name }}
        </span>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
  import { PropType } from 'vue';

  export interface overviewItem {
    name: string;
    img: string;
    num_bg: string;
  }

  const props = defineProps({
    menu: {
      type: Object as PropType<overviewItem>,
    },
  });
</script>

<style lang="less" scoped>
  .card {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    background-color: #f5f5f5;
    border-radius: 6px;
    padding: 10px 20px;

    .name {
      font-size: 20px;
      font-weight: 600;
      background-clip: text;
      color: transparent;
      &.controller {
        background-image: linear-gradient(to bottom right, #17d9e2, #31dcb7);
      }
      &.interface {
        background-image: linear-gradient(to bottom right, #ff4d4f, #f9a143);
      }
      &.model {
        background-image: linear-gradient(to bottom right, #9159df, #7db6f5);
      }
    }
  }
</style>
